// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.util.list;

import java.util.Iterator;
import java.util.function.Function;

public final class PZConvertIterable<T, S> implements Iterable<T> {
    private final Iterable<S> m_srcIterable;
    private final Function<S, T> m_converter;

    public PZConvertIterable(Iterable<S> srcIterable, Function<S, T> converter) {
        this.m_srcIterable = srcIterable;
        this.m_converter = converter;
    }

    public Iterator<T> iterator() {
        return new Iterator<T>() {
            private Iterator<S> m_srcIterator = PZConvertIterable.this.m_srcIterable.iterator();

            public boolean hasNext() {
                return this.m_srcIterator.hasNext();
            }

            public T next() {
                return (T)PZConvertIterable.this.m_converter.apply(this.m_srcIterator.next());
            }
        };
    }
}
